from time import sleep

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By

s = Service(r"./chromedriver.exe")
bro = webdriver.Chrome(service=s)

bro.get('https://qzone.qq.com/')

bro.switch_to.frame('login_frame')

a_tag = bro.find_element(By.XPATH, '//*[@id="switcher_plogin"]')
a_tag.click()

userName_tag = bro.find_element(By.ID, 'u')
password_tag = bro.find_element(By.ID, 'p')
sleep(1)
userName_tag.send_keys('1019692869')
sleep(1)
password_tag.send_keys('123456789')
sleep(1)
btn = bro.find_element(By.ID, 'login_button')
btn.click()

sleep(3)

bro.quit()
